this.main=function(){
	
	var mainwidth=frame_center.getInnerWidth() - 4;
	var mainheight=frame_center.getInnerHeight();
	var grid = new Ext.ux.tree.TreeGrid({
        enableDD: false,
        animate : false,
		useArrows : false,
		region : 'center',
		lines:true,
        enableSort:{property:'menuno',  folderSort: true},
		columns : [
		 {id : 'funccode',header : '功能编号',dataIndex : 'funccode',	width : 126,sortable : true}
        ,{id : 'funcname',header : '功能名称',dataIndex : 'funcname',	width : 120,sortable : true}
        ,{id : 'moduleurl',header : '功能url路径',dataIndex : 'moduleurl',	width : 180,sortable : true}
        ,{id : 'statemark',header : '启用标志',dataIndex : 'statemark',	width : 60,sortable : true}
        ,{id : 'menuno',header : '功能顺序',dataIndex : 'menuno',	width : 60,sortable : true}
        ,{id : 'funcdescription',header : '功能描述',dataIndex : 'funcdescription',	width : 150}
		],
		dataUrl :  basepath+'../sysControl/permission/FuncController/queryPage.do'
	
	});
	 grid.on(
            'beforeload',
            function(node) { 
                grid.loader.baseParams['pfuncid']=node.attributes["funcid"];
            }
        );
var formobj=getPageForm();
		formobj.frame =true;
		formobj.border =false;
		formobj.collapsible =true;
		formobj.title="菜单添加";
		formobj.animCollapse=false;
		formobj.animate =false;
		formobj.collapseMode ='mini';
		//formobj.collapsed=true;
		formobj.region ='east';
		formobj.padding =4;
		formobj.width =480;
	var formPanel=new Ext.form.FormPanel(formobj);

	
	var displayPanel = new Ext.Panel({
		width    : mainwidth,
		height   : mainheight,
		layout   : 'border',
        renderTo:'divLlist'+this.menuid,
		items    : [
			grid,
			formPanel
		],
		
		tbar : [
			{text:'添加'	,
			iconCls : 'table_add',
			handler:function(){
					formPanel.setTitle("添加菜单");
					formPanel.getForm().reset();
					formPanel.getForm().setValues({pfuncid:""});
					formPanel.submitUrl=basepath+"../sysControl/permission/FuncController/add.do";
				}
			},
			{text:'添加下级'	,
			iconCls : 'table_add',
			handler:function(){
					var node = grid.getSelectionModel().getSelectedNode();
						 if(!node){
						        Ext.Msg.alert("提示","请选择可用需要添加下级的菜单");
						        return;
					        }
					formPanel.submitUrl=basepath+"../sysControl/permission/FuncController/add.do";
					formPanel.setTitle("添加["+node.attributes.funcname+"]下级菜单");
					formPanel.getForm().reset();
					formPanel.getForm().setValues({pfuncid:node.attributes.funcid})
				}
			},
			{text:'修改'	,
			iconCls : 'table_edit',
			handler:function(){
					var node = grid.getSelectionModel().getSelectedNode();
						 if(!node){
						        Ext.Msg.alert("提示","请选择可用需要修改的记录");
						        return;
					        }
					    formPanel.submitUrl=basepath+"../sysControl/permission/FuncController/update.do"
					    formPanel.setTitle("菜单修改");
						formPanel.getForm().setValues(node.attributes);
					}
			},
			{text:'保存'	,
			iconCls : 'table_save',
			handler:function(){
					successFun=function(form, action) {grid.root.reload();Ext.Msg.alert("提示", action.result.info);}
					submitFormPanel(formPanel,formPanel.submitUrl,successFun)
					}
			},
			{text : '删除',
				iconCls : 'table_delete',
				handler : function() {
					var node = grid.getSelectionModel().getSelectedNode();
			        if(!node){
			        Ext.Msg.alert("提示","请选择可用需要删除的记录");
			        return;
			        }
			        deleteData(basepath+"../sysControl/permission/FuncController/delete.do",
					        "funcid="+node.attributes.funcid,grid.root,
					        '你确定要删除选择的功能菜单吗？');
				}},'->',closebtn
		]
	});
	
	destroyResize(displayPanel);
}